﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Ovvio.Web.Areas.Admin.Models.UserModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Edit
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Edit</h2>

    <% using (Html.BeginForm()) {%>
        <%= Html.ValidationSummary(true) %>
        
        <fieldset>
            <legend>Fields</legend>
            <%= Html.HiddenFor(model => model.Id) %>
            <div class="editor-label">
                <%= Html.LabelFor(model => model.Username) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor( model => model.Username, new {@readonly = "true"} ) %>
                <%= Html.ValidationMessageFor(model => model.Username) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.Password) %>
            </div>
            <div class="editor-field">
                <%= Html.PasswordFor(model => model.Password) %>
                <%= Html.ValidationMessageFor(model => model.Password) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.ConfirmPassword) %>
            </div>
            <div class="editor-field">
                <%= Html.PasswordFor(model => model.ConfirmPassword)%>
                <%= Html.ValidationMessageFor(model => model.ConfirmPassword)%>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.FirstName) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.FirstName) %>
                <%= Html.ValidationMessageFor(model => model.FirstName) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.LastName) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.LastName) %>
                <%= Html.ValidationMessageFor(model => model.LastName) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.Mobile) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.Mobile) %>
                <%= Html.ValidationMessageFor(model => model.Mobile) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.Email) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.Email) %>
                <%= Html.ValidationMessageFor(model => model.Email) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.RoleValue) %>
            </div>
            <div class="editor-field">
                <%= Html.DropDownListFor(model => model.RoleValue, Enum.GetValues(typeof(Ovvio.Web.Areas.Admin.Models.Role)).Cast<Ovvio.Web.Areas.Admin.Models.Role>().Select(x => new SelectListItem { Text = x.ToString(), Value = ((int)x).ToString() }))%>
                <%= Html.ValidationMessageFor(model => model.RoleValue)%>
            </div>
            
            <div class="editor-field">
                <%= Html.CheckBoxFor(model => model.IsActive)%>
                <%= Html.LabelFor(model => model.IsActive) %>
                <%= Html.ValidationMessageFor(model => model.IsActive) %>
            </div>
            
            <div class="editor-field">
                <%= Html.CheckBoxFor(model => model.IsNewsLetterSubscriber) %>
                <%= Html.LabelFor(model => model.IsNewsLetterSubscriber) %>
                <%= Html.ValidationMessageFor(model => model.IsNewsLetterSubscriber) %>
            </div>
            
            <p>
                <input type="submit" value="Save" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%= Html.ActionLink("Back to List", "Index") %>
    </div>

</asp:Content>

